import  './index.less';
import {useEffect,useState} from 'react';

import { useDispatch, useSelector, ClassListModelState} from 'umi';

import {PropsType} from '../../../utils/interface';

import { Table } from 'antd';


const classmate:React.FC<PropsType>=(props)=>{
    const dispatch=useDispatch();
    useEffect(() => {
        dispatch({
            type:'exam/getstudent',
            payload:{grade_id:props.match.params.id}
        })
    }, [])


    const [columns, setcolumns] = useState<any>([{
        title: '班级',
        dataIndex: '',
      },
      {
        title: '姓名',
        dataIndex: 'student_name',
      },
      {
        title: '阅卷状态',
        dataIndex: 'score',
      },
      {
        title: '开始时间',
        dataIndex: 'start_time',
      },
      {
        title: '结束时间',
        dataIndex: 'end_time',
      },
      {
        title: '成材率',
        dataIndex: '-',
      },
      {
        title: '操作',
        dataIndex: 'identity_text',
      },
      ]);

    let {listexam}=useSelector((model:{exam:ClassListModelState})=>model.exam)
    console.log(listexam);
    
    return ( <div className='classmate'>
       <div>
            
       </div>
       <div>
       <Table columns={columns}  dataSource={listexam} />
       </div>
    </div> )
}

export default  classmate